草庐IT

java - Gradle 无法执行 npm 命令

全部标签

javascript - 页面加载一段时间后执行 JS 函数

我有javascript函数,应该在页面加载完成3秒后调用。我知道setIntervel但它会在一定时间间隔后重复执行。我希望它执行一次。有可能吗? 最佳答案 Theonloadeventfiresattheendofthedocumentloadingprocess.Atthispoint,alloftheobjectsinthedocumentareintheDOM,andalltheimages,scripts,linksandsub-frameshavefinishedloading,Afteronloadyoucanuse

javascript - 执行后禁用

我有两个事件首先:$(window).on("scroll",function(){if(($(this).scrollTop()+h)>=$(".services-procent-ul").offset().top){circle();$(window).off("scroll");}});第二个:$(window).on("scroll",function(){if($(window).scrollTop()>0){$('.nav2').fadeIn('slow');$('.nav1').fadeOut('fast');}else{$('.nav2').fadeOut('fast'

javascript - 不提供文件扩展名就无法导入 TypeScript 模块

我是TypeScript的新手,我希望我应该能够导入我的TS文件而无需指定它们是TS文件。我必须做import{sealed}from"./decorators/decorators.ts";而不是我想要的是正确的方式这是import{sealed}from"./decorators/decorators";这会导致错误表明它只查找以.js或.jsx结尾的文件我的tsconfig.json看起来像这样{"compileOnSave":true,"compilerOptions":{"module":"commonjs","moduleResolution":"node","jsx":"

javascript - Jstree:无法读取未定义的属性子项。时间问题?

我有一个对象数组,其中每个对象看起来都像这样的结构:vardata=[{"code":"i1","name":"Industry1","parentCode":"i0"},{//andmoreitemsjustlikethatone}];所以我正在使用jstree来构建层次结构View。由于jstree需要id和text,我将data数组映射如下:datatree=$.map(data,function(item){return{id:item.code,text:item.name,parent:item.parentCode};});然后我在我的hierarchydiv中初始化实际

javascript - 错误 : Cannot find module 'wrench' , 当我运行 gulp 命令时出现此错误

我已经在本地和全局安装了npm、bower和gulp。当我在该文件夹中运行gulp时,仍然出现此错误。Error:Cannotfindmodule'wrench'atFunction.Module._resolveFilename(module.js:325:15)atFunction.Module._load(module.js:276:25)atModule.require(module.js:353:17)atrequire(internal/module.js:12:17)atObject.(/home/myPC/documents/workspace/frontend/gul

javascript - 无法安装 jspdf 1.5.3

我需要将html转换为pdf,我使用的是jspdf1.5.2。它显示错误Cannotreadproperty'charAt'ofundefined(usingwithhtml2canvas)。当我尝试安装jspdf1.5.3时,我得到了这个:npmERR!pathgitnpmERR!codeENOENTnpmERR!errnoENOENTnpmERR!syscallspawngitnpmERR!enoentErrorwhileexecuting:npmERR!enoentundefinedls-remote-h-tssh://git@github.com/eligrey/FileSav

javascript - 令人惊讶的是,JavaScript 代码可以执行它想要的任何进程。为什么?

我问了“Howtorunaexecutablefilefromawebpage?”很多人告诉我这是不可能的,但我的同事找到了一段可以执行任何进程的JavaScript代码。我无法相信ActiveX如此危险。怎么会这样?为什么这不被IE禁止?functionRun(strPath){try{varobjShell=newActiveXObject("wscript.shell");objShell.Run(strPath);objShell=null;}catch(e){alert('Cannotfind"'+strPath)}}notepadmspaintcalcformatc:

java - Richfaces 列过滤器 : How to fire an event on intro key

我有一个rich:extendedDataTable并且我正在使用列过滤。我希望在用户输入“intro”键后触发过滤器,但在javascript中没有这样的事件。我想这样做是因为如果我使用诸如onkeyup之类的事件,我会收到太多请求,因此会遇到问题。我正在使用richfaces3.3.0GA和facelets。这是组件: 最佳答案 不幸的是,没有简单的方法来自定义此功能。不过,有一些选项可以使其更有用:-将其放入您的或和你的onkeyup请求将被延迟和分组。参见richfacesdemopage:SettingignoreDupR

javax 脚本如何从 Java 调用 JavaScript 中的函数

我正在尝试通过Java调用JavaScript中的函数。这在直接将脚本作为字符串读取时效果很好,但我使用的是CompiledScripts。当我使用编译脚本执行此操作时,如果我还添加绑定(bind),它会提示找不到方法。没有绑定(bind)它可以工作,但当然函数失败,因为它需要绑定(bind)。有什么想法吗?CompiledScriptscript=...getscript....Bindingsbindings=script.getEngine().createBindings();LoggerscriptLogger=LogManager.getLogger("TEST_SCRIP

java - 在页面上处理 Java 表达式语言

我正在从事一个项目的前端工作,该项目为我提供了Java表达式语言标签供我使用。在一个实例中,我需要查看它是返回一个数组还是仅返回一位数据,但我不知道如何使用它。例子:页面有${WebAppContext.buildings[0].location.name}这将输出如下内容:Acme问题是如果那个建筑物位中有更多的东西,我需要输出更多的东西:类似于(伪代码)ifisArray(${WebAppContext.buildings}){foreach(${WebAppContext.buildings}asfoo){//iterateoverwhateverisinthearray}}所以